﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdDbBaseLayoutPE : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbBaseLayoutPE(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdDbBaseLayoutPE_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbBaseLayoutPE obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbBaseLayoutPE()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdDbBaseLayoutPE(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbBaseLayoutPE cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseLayoutPE_cast(OdRxObject.getCPtr(pObj));
			OdDbBaseLayoutPE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseLayoutPE_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseLayoutPE_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdDbBaseLayoutPE_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdDbBaseLayoutPE createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdDbBaseLayoutPE_createObject();
			OdDbBaseLayoutPE result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBaseLayoutPE)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string name(OdRxObject arg0)
		{
			string result = GlobalsPINVOKE.OdDbBaseLayoutPE_name(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isModelLayout(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_isModelLayout(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool printLineweights(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_printLineweights(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool showPlotStyles(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_showPlotStyles(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string paperName(OdRxObject arg0)
		{
			string result = GlobalsPINVOKE.OdDbBaseLayoutPE_paperName(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getPaperSize(OdRxObject arg0, out double paperWidth, out double paperHeight)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getPaperSize(this.swigCPtr, OdRxObject.getCPtr(arg0), out paperWidth, out paperHeight);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbBaseLayoutPE.PlotRotation plotRotation(OdRxObject arg0)
		{
			OdDbBaseLayoutPE.PlotRotation result = (OdDbBaseLayoutPE.PlotRotation)GlobalsPINVOKE.OdDbBaseLayoutPE_plotRotation(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double getTopMargin(OdRxObject arg0)
		{
			double result = GlobalsPINVOKE.OdDbBaseLayoutPE_getTopMargin(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double getRightMargin(OdRxObject arg0)
		{
			double result = GlobalsPINVOKE.OdDbBaseLayoutPE_getRightMargin(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double getBottomMargin(OdRxObject arg0)
		{
			double result = GlobalsPINVOKE.OdDbBaseLayoutPE_getBottomMargin(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual double getLeftMargin(OdRxObject arg0)
		{
			double result = GlobalsPINVOKE.OdDbBaseLayoutPE_getLeftMargin(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getId(OdRxObject arg0)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseLayoutPE_getId(this.swigCPtr, OdRxObject.getCPtr(arg0));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isOverallVPortErased(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_isOverallVPortErased(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getGeomExtents(OdRxObject arg0, OdGeExtents3d ext)
		{
			OdResult result = (OdResult)GlobalsPINVOKE.OdDbBaseLayoutPE_getGeomExtents(this.swigCPtr, OdRxObject.getCPtr(arg0), OdGeExtents3d.getCPtr(ext));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool useStandardScale(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_useStandardScale(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getStdScale(OdRxObject arg0, out double scale)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getStdScale(this.swigCPtr, OdRxObject.getCPtr(arg0), out scale);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getCustomPrintScale(OdRxObject arg0, out double numerator, out double denominator)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getCustomPrintScale(this.swigCPtr, OdRxObject.getCPtr(arg0), out numerator, out denominator);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int plotType(OdRxObject arg0)
		{
			int result = GlobalsPINVOKE.OdDbBaseLayoutPE_plotType(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getPlotViewName(OdRxObject arg0)
		{
			string result = GlobalsPINVOKE.OdDbBaseLayoutPE_getPlotViewName(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getPlotWindowArea(OdRxObject arg0, out double xmin, out double ymin, out double xmax, out double ymax)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getPlotWindowArea(this.swigCPtr, OdRxObject.getCPtr(arg0), out xmin, out ymin, out xmax, out ymax);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getPlotOrigin(OdRxObject arg0, out double x, out double y)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getPlotOrigin(this.swigCPtr, OdRxObject.getCPtr(arg0), out x, out y);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void getPlotPaperSize(OdRxObject arg0, out double paperWidth, out double paperHeight)
		{
			GlobalsPINVOKE.OdDbBaseLayoutPE_getPlotPaperSize(this.swigCPtr, OdRxObject.getCPtr(arg0), out paperWidth, out paperHeight);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int plotPaperUnits(OdRxObject arg0)
		{
			int result = GlobalsPINVOKE.OdDbBaseLayoutPE_plotPaperUnits(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbStub getBlockId(OdRxObject arg0)
		{
			IntPtr intPtr = GlobalsPINVOKE.OdDbBaseLayoutPE_getBlockId(this.swigCPtr, OdRxObject.getCPtr(arg0));
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool scalePSLinetypes(OdRxObject arg0)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_scalePSLinetypes(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool getApproxExtents(OdRxObject arg0, OdGePoint3d extMin, OdGePoint3d extMax)
		{
			bool result = GlobalsPINVOKE.OdDbBaseLayoutPE_getApproxExtents(this.swigCPtr, OdRxObject.getCPtr(arg0), OdGePoint3d.getCPtr(extMin), OdGePoint3d.getCPtr(extMax));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum PlotRotation
		{
			k0degrees,
			k90degrees,
			k180degrees,
			k270degrees
		}
	}
}
